const fs = require("fs")


//如果router文件夹下的文件没有抛出router则会报错


module.exports = (app) => {
    fs.readdirSync(__dirname).forEach(item => {
        if (item === 'index.js') return
        const router = require(`./${item}`)
        app.use(router.routes())
    })
}